import { Random } from "mockjs"; // 导出随机函数
import Mock from "mockjs";

function getHotelByPage(req: any) {
  let data = Mock.mock({
    "data": [
      {
        id: "1",
        hotelName: "@ctitle(3,7)",
        price: "@Integer(3,90)",
        starLevel: "@Integer(1,5)",
        position: "@ctitle(3,8)",
        region: "@ctitle(4,6)",
      },
      {
        id: "2",
        hotelName: "@ctitle(3,7)",
        price: "@Integer(3,90)",
        starLevel: "@Integer(1,5)",
        position: "@ctitle(3,8)",
        region: "@ctitle(4,6)",
      },
      {
        id: "3",
        hotelName: "@ctitle(3,7)",
        price: "@Integer(3,90)",
        starLevel: "@Integer(1,5)",
        position: "@ctitle(3,8)",
        region: "@ctitle(4,6)",
      },
      {
        id: "4",
        hotelName: "@ctitle(3,7)",
        price: "@Integer(3,90)",
        starLevel: "@Integer(1,5)",
        position: "@ctitle(3,8)",
        region: "@ctitle(4,6)",
      },
      {
        id: "5",
        hotelName: "@ctitle(3,7)",
        price: "@Integer(3,90)",
        starLevel: "@Integer(1,5)",
        position: "@ctitle(3,8)",
        region: "@ctitle(4,6)",
      },
    ],
  });

  return {
    success: true,
    message: "注册成功",
    code: "200",
    data:{
      data:data.data,
      total:40
    },
  };
}

function addHotel(req: any) {
  return {
    success: true,
    message: "注册成功",
    code: "200",
    data: {},
  };
}

function updateHotel(req: any) {
  return {
    success: true,
    message: "注册成功",
    code: "200",
    data: {},
  };
}

function deleteHotel(req: any) {
  return {
    success: true,
    message: "注册成功",
    code: "200",
    data: {},
  };
}

export default {
  getHotelByPage,
  addHotel,
  updateHotel,
  deleteHotel,
};
